This invention relates to a digital generator for producing a sinewave in the form of a succession of digitally encoded samples.
Digital generators may be used in digital equipment as substitutes for analogue oscillators. An example of such equipment is a modulator/demodulator (modem) for sending and receiving digitally encoded data via telephone lines, i.e via a transmission medium with a bandwidth limited to about 3 kHz. Various complex modulation techniques have been devised to enable high rates of data transmission via telephone lines in spite of the limited bandwidth, e.g. the CCITT recommendation V29 for data transmission at a rate of 9,600 bits/sec. These modulation techniques are more easily performed using digital circuits than analogue circuits, and it is therefore convenient to generate sinewaves for modulation or demodulation in a form directly suitable for digital processing.
In some circumstances it is possible to generate a succession of samples of a sinewave simply by looking up values in a table. For example, if the sinewave is generated in the form of samples at successive 90.degree. phase intervals, only the values +1,0,-1 and 0 need be stored. Further, multiplication by such numbers is very simple. In other circumstances, no such easy relationship exists between the sampling rate and the frequency desired for the generated sinewave, in which case sample values need to be calculated each time they are required since storage of enough sample values to sufficient accuracy becomes prohibitively expensive.
A known digital generator calculates successive digitally encoded sample values of a sinewave of amplitude R, with a sampling period T corresponding to a phase difference .phi. between two successive samples, by performing the following algorithm: EQU A.sub.k+1 =aA.sub.k -bB.sub.k EQU B.sub.k+1 =bA.sub.k +aB.sub.k
where a=cos .phi., b=sin .phi., A.sub.o =R and B.sub.o =0, k=0, 1, 2, . . . and the sinewave is defined at the instant k by the vector sum A.sub.k +jB.sub.k =Re.sup.jk.phi..
By substituting values into the equations of the algorithm above it can be seen that it is based on the trigonometric identities: EQU R cos (k+1).phi.=R cos .phi. cos k .phi.-R sin .phi. sin k.phi. EQU R sin (k+1).phi.=R sin .phi. cos k.phi.+R cos .phi. sin k.phi.
FIG. 1 of the accompanying drawings is a block diagram of such a generator. It comprises two delay lines 1 and 2 (e.g. buffer storage registers) providing a delay equal to T, two adders 3 and 4, two multipliers 5 and 8 and two outputs 9 and 10. Further, the figure shows two sources 11 and 12 (e.g. registers) for storing respective constants, and means 13 and 14 for initializing the generator with values A.sub.O =1 and B.sub.O =0, (i.e. in this case R=1). The sources 11 and 12 are each connected to two multipliers (6 and 7, and 5 and 8 respectively) and they supply constant sin .phi. and cos .phi. values respectively.
The multipliers also receive in pairs the signals delivered by the respective delay lines 1 and 2. Each of the adders 3 and 4 sums values from a pair of multipliers connected to receive different constants. Thus the adder 3 is connected to the outputs of the multipliers 5 and 7, while the adder 4 is connected to the outputs of the multipliers 6 and 8. The outputs of the adders are connected to respective ones of the outputs 9 and 10 as well as to the input of the corresponding delay line 1 or 2.
To explain the operation of this generator, let
a=cos .phi. PA1 b=sin .phi. PA1 A.sub.k =cos k.phi., PA1 B.sub.k =sin k.phi., PA1 k=0, 1, 2, . . .
where .phi. is the phase difference between two successive samples of the sinewave to be produced.
Initialize the generator with A.sub.o =1 and B.sub.o =0, and assume, for the moment, that its calculating and data storage units have infinite precision. The generator will then produce successive samples of the wave: EQU A.sub.k +jB.sub.k =e.sup.jk.phi.
where
and
It can be observed that the amplitude of the wave is constant and equal to unity.
To obtain a wave of any desired amplitude and A and B samples may be post-multiplied by the desired amplitude value.
Now, for the digital generator shown in FIG. 1, if calculation errors, and in particular truncation errors, are to be taken into account, and if an even number is used as the number base for calculation, the following identity: EQU a.sup.2 +b.sup.2 =1
can no longer be exactly true.
The result of this is that the amplitude of the wave delivered by the generator cannot remain stable.
The algorithm performed in FIG. 1 is: EQU A.sub.k+1 =aA.sub.k -bB.sub.k EQU B.sub.k+1 =bA.sub.k +aB.sub.k,
from which it can be deduced: EQU A.sub.k+1.sup.2 +B.sub.k+1.sup.2 =(A.sub.k.sup.2 +B.sub.k.sup.2) (a.sup.2 +b.sup.2).
Taking the initialization into account, EQU A.sub.k.sup.2 +B.sub.k.sup.2 =(a.sup.2 +b.sup.2).sup.k,
which indicates that the amplitude of the wave produced will tend exponentially towards infinity or zero depending on whether (a.sup.2 +b.sup.2) is greater than or less than unity.